import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";

// https://vitejs.dev/config/
export default defineConfig({
  server: {
    host: "localhost",
    port: 8081, // 端口
    proxy: {
      "/api": {
        // 请求接口中要替换的标识
        target: "http://117.62.22.235:17009", // 代理地址
        changeOrigin: true, // 是否允许跨域
        secure: true,
        rewrite: (path) => path.replace(/^\/api/, ""), // api标志替换为''
      },
    },
  },

  plugins: [react()],
  resolve: {
    alias: {
      "@": "/src",
    },
  },
});
